

include_directories(${PROJECT_SOURCE_DIR}/include
                    ${PROJECT_SOURCE_DIR}/src
                    $ENV{DDS_PSM_CXX}/src/hpp )

set (oxtypes_src
    dds/type/dynamic/Descriptor.cpp
    dds/type/dynamic/DynamicType.cpp
    dds/type/dynamic/DynamicTypeMember.cpp
    dds/type/dynamic/DynamicTypeFactory.cpp
    oxtypes/impl/DynamicTypeImpl.cpp
    oxtypes/impl/DynamicTypeMemberImpl.cpp
    oxtypes/impl/PrimitiveTypesImpl.cpp
    oxtypes/impl/DynamicTypeManagerImpl.cpp
    oxtypes/DynamicTypeFinder.cpp
    dds/type/dynamic/DynamicTypeFactory.cpp
)

add_library(lib${PROJECT_NAME} ${oxtypes_src})

target_link_libraries(lib${PROJECT_NAME})

add_custom_target( lib DEPENDS lib${PROJECT_NAME} )

# change lib_target properties
set_target_properties( lib${PROJECT_NAME} PROPERTIES
   # create *nix style library versions + symbolic links
   VERSION ${${PROJECT_NAME}_VERSION}
   SOVERSION ${${PROJECT_NAME}_SOVERSION}
   # allow creating static and shared libs without conflicts
   CLEAN_DIRECT_OUTPUT 1
   # avoid conflicts between library and binary target names
   OUTPUT_NAME ${PROJECT_NAME} )

# force some variables that could be defined in the command line to be written to cache 
set( BUILD_SHARED_LIBS "${BUILD_SHARED_LIBS}" CACHE BOOL
   "Set to OFF to build static libraries" FORCE )

# display status message for important variables
MESSAGE( STATUS )
MESSAGE( STATUS "----------------------------------------------" )
MESSAGE( STATUS "BUILD_SHARED_LIBS = ${BUILD_SHARED_LIBS}" )
MESSAGE( STATUS "----------------------------------------------" )
MESSAGE( STATUS "OxTypes v${${PROJECT_NAME}_SOVERSION}")
MESSAGE( STATUS "----------------------------------------------" )
MESSAGE( STATUS )

